package com.kunpu.framework.commons.result;

import java.io.Serializable;

/**
 * 数据统一返回封装
 * @author wangtq
 * @date 2016-10-2 
 * @version 0.1
 *
 */
public class Result<T> implements Serializable{
	
	private static final long serialVersionUID = 8045114316863175296L;

	/**
	 * 成功失败返回标识：true|成功，false|失败
	 */
	private boolean success;
	
	/**
	 * 成功后返回数据信息
	 */
	private T model;
	
	/**
	 * 失败后返回错误code
	 */
	private String code;
	
	/**
	 * 失败后返回错误信息
	 */
	private String message;
	
	
	public Result(boolean success,T model){
		this.success = success;
		this.model = model;
	}
	public Result(boolean success,String code,String message){
		this.success = success;
		this.code = code;
		this.message = message;
	}
	
	public boolean isSuccess() {
		return success;
	}
	public void setSuccess(boolean success) {
		this.success = success;
	}
	public T getModel() {
		return model;
	}
	public void setModel(T model) {
		this.model = model;
	}
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	public String getMessage() {
		return message;
	}
	public void setMessage(String message) {
		this.message = message;
	}
	
	
}
